package unclassified.simple;

public class Convert1DArrayInto2DArray_2022 {

    public int[][] construct2DArray(int[] original, int m, int n) {
        if (m * n != original.length) {
            return new int[0][];
        }
        int[][] res = new int[m][n];
        int i = 0;
        while (i < original.length) {
            res[i / n][i % n] = original[i];
            i++;
        }
        return res;
    }

    public static void main(String[] args) {
    }
}
